/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "patrim_depreciacao_bem")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PatrimDepreciacaoBem.findAll", query = "SELECT p FROM PatrimDepreciacaoBem p")})
public class PatrimDepreciacaoBem implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(name = "DATA_DEPRECIACAO")
    @Temporal(TemporalType.DATE)
    private Date dataDepreciacao;
    private Integer dias;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(precision = 18, scale = 6)
    private BigDecimal taxa;
    @Column(precision = 18, scale = 6)
    private BigDecimal indice;
    @Column(precision = 18, scale = 6)
    private BigDecimal valor;
    @Column(name = "DEPRECIACAO_ACUMULADA", precision = 18, scale = 6)
    private BigDecimal depreciacaoAcumulada;
    @JoinColumn(name = "ID_PATRIM_BEM", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private PatrimBem idPatrimBem;

    public PatrimDepreciacaoBem() {
    }

    public PatrimDepreciacaoBem(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDataDepreciacao() {
        return dataDepreciacao;
    }

    public void setDataDepreciacao(Date dataDepreciacao) {
        this.dataDepreciacao = dataDepreciacao;
    }

    public Integer getDias() {
        return dias;
    }

    public void setDias(Integer dias) {
        this.dias = dias;
    }

    public BigDecimal getTaxa() {
        return taxa;
    }

    public void setTaxa(BigDecimal taxa) {
        this.taxa = taxa;
    }

    public BigDecimal getIndice() {
        return indice;
    }

    public void setIndice(BigDecimal indice) {
        this.indice = indice;
    }

    public BigDecimal getValor() {
        return valor;
    }

    public void setValor(BigDecimal valor) {
        this.valor = valor;
    }

    public BigDecimal getDepreciacaoAcumulada() {
        return depreciacaoAcumulada;
    }

    public void setDepreciacaoAcumulada(BigDecimal depreciacaoAcumulada) {
        this.depreciacaoAcumulada = depreciacaoAcumulada;
    }

    public PatrimBem getIdPatrimBem() {
        return idPatrimBem;
    }

    public void setIdPatrimBem(PatrimBem idPatrimBem) {
        this.idPatrimBem = idPatrimBem;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PatrimDepreciacaoBem)) {
            return false;
        }
        PatrimDepreciacaoBem other = (PatrimDepreciacaoBem) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.PatrimDepreciacaoBem[ id=" + id + " ]";
    }
    
}
